package com.fusion.launchers.ui;

import java.awt.*;


//This is a dirty hack to get around java sucking, found the code here http://weblogs.java.net/blog/ixmal/archive/2006/05/using_jpopupmen.html
//otherwise linux will give you wonderful class cast exceptions
/**
 * @author SwethaShivakumar 
 * Project: fusion
 * Date: Mar 17, 2009
 * URL: http://fusionwiki.co.cc
 * Mail Me At: shiva@fusionproject.co.cc
 */
public class PopupFixQueue extends EventQueue {
    @SuppressWarnings("unused")
	private PopupMenu popup;

    public PopupFixQueue(PopupMenu m) {
        this.popup = m;
    }

    protected void dispatchEvent(AWTEvent event) {
        try {
            super.dispatchEvent(event);
        } catch (RuntimeException ex) {
            if (event.getSource() instanceof TrayIcon) {
                //popup.setVisible(false);
            } else {
                throw ex;
            }
        }
    }
}
